{extend name="admin@extend/layui" /}

{block name="head_title"}{/block}

{block name="head_styles"}
<script type="text/javascript">
    var commParam = {$commParam|json_encode};
</script>
{/block}

{block name="body_content"}
<body>
<div class="layui-fluid" style="padding: 15px;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-card" lay-filter="product-tab">
                        <ul class="layui-tab-title">
                            <li class="layui-this" data-step="1">【步骤1：用户基本信息】</li>
                            <li data-step="2">【步骤2：所属角色】</li>
                            <li data-step="3">【步骤3：保存】</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show" data-step="1">{include file="auth/simple_rbac/user/save_step1" /}</div>
                            <div class="layui-tab-item" data-step="2">{include file="auth/simple_rbac/user/save_step2" /}</div>
                            <div class="layui-tab-item" data-step="3">{include file="auth/simple_rbac/user/save_step3" /}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
{/block}

{block name="body_scripts"}
<script type="text/javascript">
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use(['element','jquery','form'], function(){
        var element = layui.element;
        var form = layui.form;
        window.$ = layui.jquery;

        //一些事件监听
        element.on('tab(product-tab)', function(ret){
            console.log(ret);
            if(ret.index == 2){
                // 保存
                add_step3_init();
            }
        });
    });
    // layui问题之模拟select点击事件
    // $('select[name="modules"]').next().find('.layui-select-title input').click();
    // 延迟3s再实现自动点击下拉框事件
    // setTimeout(function () { $('select[name="modules"]').next().find('.layui-anim').children('dd[lay-value="20"]').click(); });
</script>
{/block}